class News {
  String id;
  String title;
  int hits;
  String coverUrl;
  DateTime createTime;

  News({this.id, this.title, this.hits, this.coverUrl, this.createTime});

  static News fromJson(Map<String, dynamic> json) {
    return News(
      id: json['id'].toString(),
      title: json['title'] as String,
      hits: json['hits'] as int,
      coverUrl: json['coverUrl'] as String,
      createTime: DateTime.parse(json['createTime']),
    );
  }
}
